<template>
  <view>
    <view class="user">
      <view>user模块</view>
      <view>name:{{ name }}</view>
      <view>age:{{ age }}</view>
      <button @click="M_age">age++</button>
      <view></view>
    </view>
    <view class="company">
      <view>企业模块</view>
      <view>money:{{ money }}万</view>
      <button @click="M_money">money+=10</button>
    </view>
  </view>
</template>

<script>
import { mapState, mapMutations, mapGetters } from "vuex";
export default {
  computed: {
    ...mapState("user", ["name", "age"]),
    ...mapGetters(["money"]),
  },
  methods: {
    ...mapMutations("user", ["M_age"]),
    ...mapMutations("company", ["M_money"]),
  },
};
</script>

<style lang="scss" scoped>
.user {
  border: 1px solid #123;
  height: 400rpx;
}
.company {
  height: 400rpx;
  border: 1px solid red;
}
</style>
